package com.lanyam.travel.base.entity.base;


import com.lanyam.travel.base.utils.StateUtils;

public class DataResponse<T> extends BaseResponse{
    private T data;

    public static <T> DataResponse getInstance(int errcode, T data) {
        DataResponse response = new DataResponse();
        response.setErrcode(errcode);
        response.setData(data);
        return response;
    }

    public static <T> DataResponse ok(T data) {
        DataResponse response = new DataResponse();
        response.setErrcode(StateUtils.ERRCODE_OK);
        response.setData(data);
        return response;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
